Skip to content

сhore(ci): improve e2e nightly report#2245

Open
universal-itengineer wants to merge 20 commits intomainfrom
chore/ci/improve-e2e-nightly-report
Open

сhore(ci): improve e2e nightly report#2245
universal-itengineer wants to merge 20 commits intomainfrom
chore/ci/improve-e2e-nightly-report

Conversation

@universal-itengineer
Copy link
Copy Markdown
Member

@universal-itengineer universal-itengineer commented Apr 20, 2026

Description

Refactor report aggregation from "nested E2E tests" results: use JS code to aggregate JSON reports from Ginkgo instead of shell-based XML reports aggregation. JS code is more maintainable and covered with unit tests.

The change introduces two public report entrypoints:

  • cluster-report.js, which builds one comprehensive e2e_report_<storage>.json artifact per cluster from workflow stage results and an optional raw Ginkgo JSON report;
  • messenger-report.js, which reads the generated cluster artifacts, renders the consolidated nested-cluster E2E summary, and optionally publishes the main message and failed-tests thread to Loop.

Supporting code is split by responsibility under report/shared/ and report/messenger/ so the workflow-facing entrypoints stay easy to find while the implementation remains modular.

The reusable pipeline now passes report configuration explicitly to the cluster report builder, uploads final report artifacts with overwrite enabled for job reruns, and keeps the final report contract self-contained. The matrix workflow downloads those final artifacts and no longer relies on hardcoded fallback environment variables to reconstruct cluster state.

Additional unit tests, linting configuration, JSDoc annotations, and local report wrappers were added or updated for the new reporting flow.

Why do we need it, and what problem does it solve?

The previous implementation built E2E summaries with large inline shell scripts in workflows. That approach was hard to maintain, hard to test, and fragile when artifacts were missing or when failures happened before the E2E stage.

This change moves the reporting flow into tested JavaScript modules and uses a single final JSON report per cluster as the contract between workflow stages. That makes report generation easier to validate, easier to evolve, and less dependent on brittle shell parsing.

It also improves failure handling by preserving cluster setup status separately from E2E test status, distinguishing test failures from setup failures, supporting missing or invalid Ginkgo reports explicitly, and deriving failed-test metrics from the parsed Ginkgo JSON report.

As a result, nested-cluster E2E reporting becomes more reliable and maintainable for successful runs, failed runs, cancelled runs, and rerun test jobs.

What is the expected result?

  1. Run the nested E2E workflows for configured storage types.
  2. The reusable pipeline uploads the raw Ginkgo report when available and produces a final structured e2e_report_<storage>.json artifact for each cluster.
  3. Each final cluster artifact contains clusterStatus, testStatus, metrics, failed tests, branch metadata, and workflow run links.
  4. The matrix workflow downloads the final cluster artifacts and renders a consolidated summary.
  5. The summary message contains:
    • a test results table for clusters with E2E test results;
    • a separate cluster failures section for setup-stage failures;
    • a missing reports section when final report artifacts or Ginkgo reports are unavailable;
    • a failed-tests thread when testcase-level failures are available.
  6. If Loop credentials are configured, both the main message and the thread replies are sent through the Loop API.

Checklist

  • The code is covered by unit tests.
  • e2e tests passed.
  • Documentation updated according to the changes.
  • Changes were tested in the Kubernetes cluster manually.

Changelog entries

section: ci
type: fix
summary: "Refactor nested E2E report generation into tested Node.js scripts with JSON reports and improve Loop reporting for missing artifacts, skipped tests, and stage failures."
impact_level: low

@universal-itengineer universal-itengineer changed the title Chore/ci/improve e2e nightly report сhore(ci): improve e2e nightly report Apr 20, 2026
@universal-itengineer universal-itengineer force-pushed the chore/ci/improve-e2e-nightly-report branch 2 times, most recently from 5497087 to 32d79af Compare April 24, 2026 12:21
@universal-itengineer universal-itengineer added this to the v1.9.0 milestone Apr 24, 2026
@universal-itengineer universal-itengineer marked this pull request as ready for review April 24, 2026 12:28
Comment thread .github/scripts/js/e2e/report/cluster-report.js Outdated
Comment thread .github/scripts/js/e2e/report/cluster-report.js Outdated
Comment thread .github/scripts/js/e2e/report/cluster-report.js Outdated
Comment thread .github/scripts/js/e2e/report/cluster-report.js Outdated
Comment thread .github/scripts/js/e2e/report/cluster-report.js Outdated
@universal-itengineer universal-itengineer force-pushed the chore/ci/improve-e2e-nightly-report branch 3 times, most recently from f8b5531 to 35d8060 Compare April 28, 2026 11:22
@universal-itengineer universal-itengineer force-pushed the chore/ci/improve-e2e-nightly-report branch 4 times, most recently from 35d8060 to 89e55d7 Compare May 4, 2026 10:49
Signed-off-by: Nikita Korolev <nikita.korolev@flant.com>

move scripts to folder

Signed-off-by: Nikita Korolev <nikita.korolev@flant.com>

use treds for send messages

Signed-off-by: Nikita Korolev <nikita.korolev@flant.com>

fix

Signed-off-by: Nikita Korolev <nikita.korolev@flant.com>

refactor js scripts report

Signed-off-by: Nikita Korolev <nikita.korolev@flant.com>

upd scripts

Signed-off-by: Nikita Korolev <nikita.korolev@flant.com>

refactor gen report

Signed-off-by: Nikita Korolev <nikita.korolev@flant.com>

refactor flow and js report

Signed-off-by: Nikita Korolev <nikita.korolev@flant.com>

fix report, add skipped to report

Signed-off-by: Nikita Korolev <nikita.korolev@flant.com>

refactor and fix ci

Signed-off-by: Nikita Korolev <nikita.korolev@flant.com>

change pickLatestMatchingFile to findSingleMatchingFile

Signed-off-by: Nikita Korolev <nikita.korolev@flant.com>

add jsdoc

Signed-off-by: Nikita Korolev <nikita.korolev@flant.com>

use json report instead of junit xml

Signed-off-by: Nikita Korolev <nikita.korolev@flant.com>
Signed-off-by: Nikita Korolev <nikita.korolev@flant.com>
Signed-off-by: Nikita Korolev <nikita.korolev@flant.com>

fix report when rerun test job, rm magic envs

Signed-off-by: Nikita Korolev <nikita.korolev@flant.com>
@universal-itengineer universal-itengineer force-pushed the chore/ci/improve-e2e-nightly-report branch from 89e55d7 to 5abc8fe Compare May 4, 2026 10:51
Signed-off-by: Nikita Korolev <nikita.korolev@flant.com>
Signed-off-by: Nikita Korolev <nikita.korolev@flant.com>
Signed-off-by: Nikita Korolev <nikita.korolev@flant.com>
Signed-off-by: Nikita Korolev <nikita.korolev@flant.com>
Signed-off-by: Nikita Korolev <nikita.korolev@flant.com>
Comment thread .github/scripts/js/e2e/report/messenger/markdown.js Outdated
Comment thread .github/workflows/e2e-matrix.yml Outdated
Comment thread .github/scripts/js/e2e/report/messenger/loop-client.js
Comment thread .github/scripts/js/e2e/report/messenger/model.js Outdated
Comment thread .github/workflows/e2e-reusable-pipeline.yml Outdated
Signed-off-by: Nikita Korolev <nikita.korolev@flant.com>
Comment thread .github/scripts/js/e2e/report/shared/fs-utils.js
Comment thread .github/scripts/js/e2e/report/shared/ginkgo-report-utils.js Outdated
Comment thread .github/scripts/js/e2e/report/cluster-report.js Outdated
Comment thread .github/scripts/js/e2e/report/messenger-report.js Outdated
Comment thread .github/scripts/js/e2e/report/messenger/model.js Outdated
Signed-off-by: Nikita Korolev <nikita.korolev@flant.com>
Signed-off-by: Nikita Korolev <nikita.korolev@flant.com>
Signed-off-by: Nikita Korolev <nikita.korolev@flant.com>
Signed-off-by: Nikita Korolev <nikita.korolev@flant.com>
Signed-off-by: Nikita Korolev <nikita.korolev@flant.com>
Signed-off-by: Nikita Korolev <nikita.korolev@flant.com>
@universal-itengineer universal-itengineer force-pushed the chore/ci/improve-e2e-nightly-report branch from 2ad071f to 8097f16 Compare May 6, 2026 09:23
Signed-off-by: Nikita Korolev <nikita.korolev@flant.com>
Comment thread .github/scripts/js/e2e/report/messenger-report.js Outdated
* @returns {string} Extracted storage type, or an empty string when not parseable.
*/
function clusterKeyFromFilename(reportFile) {
const match = path.basename(reportFile).match(/^e2e_report_([^_.]+)/);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we move this regex to a const? I see a lot of this e2e_report.*.json flying around in code, maybe we can get rid of these magic strings?

* threadMessages: string[]
* }>} Rendered messages.
*/
async function renderMessengerReport({ core, reportsDir }) {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why have an argument reportsDir if we call renderMessengerReport only once and it doesn't pass this parameter?

Comment thread .github/scripts/js/e2e/report/messenger/loop-client.js Outdated
Comment thread .github/scripts/js/e2e/report/messenger/config.js Outdated
Comment thread .github/scripts/js/e2e/report/messenger/markdown.js Outdated
Comment thread .github/scripts/js/e2e/report/shared/ginkgo-report-utils.js Outdated
Comment thread .github/scripts/js/e2e/report/shared/ginkgo-report-utils.js
Comment thread .github/scripts/js/e2e/report/messenger/loop-client.js Outdated
Comment thread .github/scripts/js/e2e/report/messenger/config.js Outdated
universal-itengineer and others added 3 commits May 7, 2026 18:52
Co-authored-by: Ivan Mikheykin <ivan.mikheykin@flant.com>
Signed-off-by: Nikita Korolev <141920865+universal-itengineer@users.noreply.github.com>
Co-authored-by: Maksim Fedotov <maksim.fedotov@flant.com>
Signed-off-by: Nikita Korolev <141920865+universal-itengineer@users.noreply.github.com>
Signed-off-by: Nikita Korolev <nikita.korolev@flant.com>
@universal-itengineer universal-itengineer force-pushed the chore/ci/improve-e2e-nightly-report branch from 3ebd18a to 5cf1899 Compare May 7, 2026 16:03
Signed-off-by: Nikita Korolev <nikita.korolev@flant.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants